package com.mrjy.maintain.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.mrjy.common.dto.CardListDto;
import com.mrjy.common.entity.SalesCardInfo;

public interface ISalesCardInfoDao {
	
	/**
	 * 查询最新记录
	 * @return
	 */
	public SalesCardInfo queryLastRecord();

	public SalesCardInfo queryById(int id);
	/**
	 * 根据激活卡密码查询销售卡
	 * @param activationCode
	 * @return
	 */
	public SalesCardInfo queryByActivationCode(String activationCode);
	
	/**
	 * 后台获取卡总数
	 * @param salesCardInfo
	 * @return
	 */
	public int getTotalCardCount(SalesCardInfo salesCardInfo);
	/**
	 * 后台分页查询
	 * @param salesCardInfo
	 * @return
	 */
	public List<SalesCardInfo> queryCardByPage(SalesCardInfo salesCardInfo);
	
	/**
	 * 批量导出
	 * @param salesCardInfo
	 * @return
	 */
	public List<CardListDto> queryExportCardList(SalesCardInfo salesCardInfo);
	
	public int insert(SalesCardInfo salesCardInfo);
	
	/**
	 * 批量插入
	 * @param list
	 * @return
	 */
	public int insertCardBatch(List<SalesCardInfo> list);
	
	/**
	 * 修改销售卡信息
	 * @param salesCardInfo
	 * @return
	 */
	public int updateSalesCard(SalesCardInfo salesCardInfo);
	
	/**
	 * 批量禁用起用
	 * @param salesCardInfo
	 * @return
	 */
	public int updateDisableFlag(SalesCardInfo salesCardInfo);
	/**
	 * 批量生成激活码的方法
	 * @param map
	 * @return
	 */
	public ArrayList<String> getNotRepeatActivationCode(Map<String, Object> map);

	public SalesCardInfo hasGetFree(SalesCardInfo info);
}
